import matplotlib.pyplot as plt
import random
vi=5
Ra=30000#30K
Rb=100
R1=1000
R2=327
R3=32000
R4=5300
R5=32000
W1=[[] for i in range(100)]
T=list(range(0,200))
for Ri in range(100,300):
    vout=((Ri/(Ri+Ra))*vi-(Rb/(Rb+Ra))*vi+((Rb*R2)/(Ra*R3))*vi)*(R2+R3)/R2
    VMCU=vout+(vi-vout)*R4/(R4+R5)
    W1[0].append(VMCU)
mmm=1
for i in range(0,99):   
    Ra+=random.uniform(-99,99)
    Rb+=random.uniform(-99,99)
    R1+=random.uniform(-99,99)
    R2+=random.uniform(-99,99)
    R3+=random.uniform(-99,99)
    R4+=random.uniform(-99,99)
    R5+=random.uniform(-99,99)
    for Ri in range(100,300):
        vout=((Ri/(Ri+Ra))*vi-(Rb/(Rb+Ra))*vi+((Rb*R2)/(Ra*R3))*vi)*(R2+R3)/R2
        VMCU=vout+(vi-vout)*R4/(R4+R5)
        W1[mmm].append(VMCU)
    mmm+=1
    Ra=30000#30K
    Rb=100
    R1=1000
    R2=327
    R3=32000
    R4=5300
    R5=32000        
plt.style.use("ggplot")
for i in range(0,100):
    dd=W1[i][0]-W1[0][0]
    W1[i] = [i-dd for i in W1[i]]
    plt.plot(T,W1[i])
plt.show()
print("end")